package cn.getech.data.development.mapper;

import cn.getech.data.development.entity.BdpServiceAlarm;
import cn.getech.data.development.model.vo.ServiceAlarmSearchVO;
import cn.getech.data.development.model.vo.ServiceAlarmVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 服务告警配置表(BdpServiceAlarm)表数据库访问层
 *
 * @author makejava
 * @since 2021-05-14 16:50:07
 */
@Mapper
public interface BdpServiceAlarmMapper extends BaseMapper<BdpServiceAlarm> {

    IPage<ServiceAlarmVO> serviceAlarmPage(Page<ServiceAlarmVO> page, @Param("serviceAlarmSearchVO") ServiceAlarmSearchVO serviceAlarmSearchVO);

    Integer selectServiceAlarmByName(@Param("id")Integer id,@Param("name")String name,@Param("tenantId")Integer tenantId);

    @MapKey("userId")
    List<Map<String,Object>> selcetUserList(@Param("tenantId")Integer tenantId);
    @MapKey("serviceGroupId")
    List<Map<String,Object>> groupList(@Param("tenantId")Integer tenantId);
    @MapKey("serviceGroupId")
    List<Map<String,Object>> groupListByUserId(@Param("userId") Long userId,@Param("tenantId")Integer tenantId);
    @MapKey("serviceId")
    List<Map<String,Object>> serviceList(@Param("id")Integer id,@Param("tenantId")Integer tenantId);

    List<BdpServiceAlarm> selectServiceAlarmListByServiceId(@Param("id")Integer id,@Param("tenantId")Integer tenantId);
    @MapKey("userId")
    List<Map<String,Object>> selectReceiverInfoList(@Param("serverAlarmId")Integer serverAlarmId,@Param("tenantId")Integer tenantId);

}
